-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add production support to Lua API, port gdi04a, gdi04b and intervention missions #6762
Conversation
"If an actionFunc is given, it will be called as actionFunc(Actor[] actors) once " + | ||
"production of all actors has been completed. The actors array is guaranteed to " + | ||
"only contain alive actors.")] | ||
public bool BuildMix(string[] actorTypes, LuaFunction actionFunc = null) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not a fan of this method name. Could we remove the method above, and call this one Build
instead? I don't think its unreasonable to expect scripts to call e.g. { "e1", "e1", "e1" }
if they want to build multiple of a unit, as this is how the reinforcements code already works.
From a comment on the website:
Could you fix this here, too? |
da83ed5
to
9d17773
Compare
updated |
9d17773
to
bfdf078
Compare
} | ||
|
||
[Desc("Start repairs on this building. `repairer` can be an allied player.")] | ||
public void RepairBuilding(Player repairer = null) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It might be a good idea to rename this to BeginRepairing
and add a matching EndRepairing
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is scope creep for this pr, but we should also add equivalent methods for powering down and selling structures before the release.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd like to do that in a separate pr that I had planned
bfdf078
to
7ff51f4
Compare
Updated |
[Desc("Checks whether the factory is currently producing anything on the queue that produces this type of actor.")] | ||
public bool IsProducing(string actorType) | ||
{ | ||
var queue = queues.Where(q => GetBuildableInfo(actorType).Queue.Contains(q.Info.Type)).FirstOrDefault(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will have issues if there are multiple queues of the same type on the actor. I suggest something like:
if (triggers.Triggers[Trigger.OnProduction].Any())
return true;
return queues.Where(q => GetBuildableInfo(actorType).Queue.Contains(q.Info.Type))
.Any(q => queue.CurrentItem() != null);
Error in GDI04a, after moving units into the Nod base after first destroying the hand of nod from the ridge: |
GDI04B has the same issue with dead hand. |
7ff51f4
to
39ca6af
Compare
Updated |
👍 for the C# code, and tested (and successfully completed) the GDI04 missions. I haven't put a lot of effort into testing Intervention. |
Needs a rebase and some adjustments due to #6776. |
As I said in IRC this should be fixed in general #4354. We will probably want to fix the bridge linking here instead in the map. There is a valid reason to go to the village and station some AA troops. |
* fixes a memory leak * moves the cleanup into a FrameEndTask to avoid collisions with the trigger iterator (fixes OpenRA#6747)
39ca6af
to
22e6e5d
Compare
Updated and rebased. Removed the bridge repair ability from e6s and added a try/catch block to the new trigger. |
👍 on the trigger scripting. The winning scenario works fine. |
Add production support to Lua API, port gdi04a, gdi04b and intervention missions
No description provided.